﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.SessionState;
using DBA.Model;

namespace DBA.Web.UI
{
    public class ServerContext
    {
        private static HttpSessionState SessionValue
        {
            get { return HttpContext.Current.Session; }
        }

        /// <summary>
        /// 当前登录后台用户
        /// </summary>
        public static OperatingUser AdminCurrentUser
        {
            get
            {
                return SessionValue["ServerContext_AdminCurrentUser"] as OperatingUser;
            }
            set
            {
                SessionValue["ServerContext_AdminCurrentUser"] = value;
            }
        }

        /// <summary>
        /// 当前登录前台用户
        /// </summary>
        public static OperatingUser CurrentUser
        {
            get
            {
                return SessionValue["ServerContext_CurrentUser"] as OperatingUser;
            }
            set
            {
                SessionValue["ServerContext_CurrentUser"] = value;
            }
        }
    }
}
